package com.heima.day08;

import java.util.List;
import java.util.Random;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
//2021531课后作业第八题解法.
public class Demo_8 {
    public static void main(String[] args) {

       // List<String> l=;
        //l.add("b");
        Scanner sc=new Scanner(System.in);
        int i=5;
        while(i>=0){
            System.out.println("输入身份证号码:");
            String s=sc.nextLine();
            Pattern pattern=Pattern.compile("[123456789]\\d{16}[0123456789X]+");
            Matcher matcher=pattern.matcher(s);
            boolean bl=matcher.matches();
            System.out.println(bl);
            System.out.println(s.matches("[123456789]"));
            i--;
        }
    }
}
